package WordGame;

/**
 * @Author quan
 * @Description 测试类
 * @Date 2023/1/22 20:18
 */

public class GameTest {
    public static void main(String[] args) {
        //2、实例化两个对象，这里调用的是“带参数的构造方法”
        Role r1 = new Role("小宏",100,'男');
        Role r2 = new Role("小兰",100,'女');
        r1.showRoleInfo();
        r2.showRoleInfo();

        while(true){
            r1.attack(r2);
            if(r2.getBlood()==0){
                System.out.println(r1.getName()+"KO"+r2.getName());
                break;
            }

            r2.attack(r1);
            if(r1.getBlood()==0){
                System.out.println(r2.getName()+"KO"+r1.getName());
                break;
            }
        }
    }
}
